﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 招聘网站
{
    public partial class Form1 : Form
    {
        public static string b;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            string sex = "";
            string str = "";
            string jgk = "";
            sex = textBox1.Text;
            str = textBox2.Text;
            jgk = textBox3.Text;
            Form2.a = textBox1.Text;
            if (textBox2.Text == textBox3.Text)
            {
                string SqlStr = "server=.;database=zhaopin;integrated security=SSPI";
                SqlConnection con = new SqlConnection(SqlStr);
                con.Open();
                SqlCommand comm = new SqlCommand();
                comm.Connection = con;
                con.Close();
                if (radioButton2.Checked == true)
                {
                    con.Open();
                    comm.Connection = con;
                    comm.CommandText = "insert into table_1(phonenumb,mima) values( '" + textBox1.Text + "','" + textBox2.Text + "')";
                    comm.ExecuteNonQuery();
                    con.Close();
                    MessageBox.Show("注册成功", "正确", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    Form4 f4 = new Form4();
                    f4.Show();
                    this.Hide();
                    b = textBox1.Text;
                }
                else if (radioButton1.Checked == true)
                {
                    con.Open();
                    comm.Connection = con;
                    comm.CommandText = "insert into table_5(phonenumb,mima) values( '" + textBox1.Text + "','" + textBox2.Text + "')";
                    comm.ExecuteNonQuery();
                    con.Close();
                    MessageBox.Show("注册成功", "正确", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    Form9 f9 = new Form9();
                    f9.Show();
                    this.Hide();
                }
           
             }
                else

                    MessageBox.Show("两次密码输入不一致，请重新输入！", "错误", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                textBox1.Clear();
                textBox2.Clear();
                textBox3.Clear();
                textBox1.Focus();
               
            }
        
         

        private void label11_Click(object sender, EventArgs e)
        {
             Form2 f2 = new Form2();
            f2.Show();
             this.Hide();
        }
                

        private void label8_Click(object sender, EventArgs e)
        {

        }

        private void label9_Click(object sender, EventArgs e)
        {

        }

        private void label10_Click(object sender, EventArgs e)
        {

        
        }

        private void Form1_Load(object sender, EventArgs e)
        {

          
        }

        private void label10_Click_1(object sender, EventArgs e)
        {
           
        }

        private void Form1_Load_1(object sender, EventArgs e)
        {
           
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
           
        }

        private void label4_Click(object sender, EventArgs e)
        {

        }
    }
}
